import request from '@/utils/request'

// 查询自定义档案列表
export function listArchive(query) {
  return request({
    url: '/system/archive/list',
    method: 'get',
    params: query
  })
}

// 查询自定义档案详细
export function getArchive(pkDefdoc) {
  return request({
    url: '/system/archive/' + pkDefdoc,
    method: 'get'
  })
}

// 新增自定义档案
export function addArchive(data) {
  return request({
    url: '/system/archive',
    method: 'post',
    data: data
  })
}

// 修改自定义档案
export function updateArchive(data) {
  return request({
    url: '/system/archive',
    method: 'put',
    data: data
  })
}

// 删除自定义档案
export function delArchive(pkDefdoc) {
  return request({
    url: '/system/archive/' + pkDefdoc,
    method: 'delete'
  })
}

// 获取root
export function getroot(query) {
  return request({
    url: '/system/archive/getroot',
    method: 'get',
    params: query
  })
}

// 获取子节点
export function getchildren(query) {
  return request({
    url: '/system/archive/getchildren',
    method: 'get',
    params: query
  })
}
